#@layout()

#define script()
<script>

    function doDel(id) {
        ajaxGet("/admin/message/jpress_addon_message/doDel/" + id);
    }

</script>
#end

#define content()

    <section class="content-header">
        <div class="container-fluid">
            <div class="row">
                <div class="col-sm-6 mb-2">
                    <div class="row mb-2">
                        <div class="col-sm-12">
                            <h1>
                                留言列表
                                <small data-toggle="tooltip" title="" data-placement="right"
                                       data-trigger="hover"><i class="nav-icon far fa-question-circle"></i></small>
                                <small> 首页 / 留言管理 / 留言列表</small>
                            </h1>
                        </div>
                    </div>

                </div>
                <div class="col-sm-6">
                    <div class=" float-sm-right">
                        <a href="./edit" class="btn btn-primary ">
                            <i class="fas fa-plus"></i> 新建
                        </a>
                    </div>
                </div>
            </div>
        </div><!-- /.container-fluid -->
    </section>

    <section class="content">

        <div class="container-fluid">
                <div class="card card-outline card-primary">

                    <!-- /.card-header -->
                    <div class="card-body p-0">

                        <table class="table table-striped">
                            <tbody>
                            <tr>
                                <th style="width: 10px">
	                                    <input class="tableCheckAll" id="checkall" type="checkbox"/>
	                                </th>
	                                <th></th>
	                                <th>名字</th>
	                                <th>电话</th>
	                                <th>邮箱</th>
	                                <th>标题</th>
	                                <th>留言</th>
	                                <th>是否展示</th>

                            </tr>
                            #for(entry : page.list)
                            <tr>
                                <td><input name="tableItem" type="checkbox" value="#(entry.id)" />
                                </td>
                                <td width="200px">
                                    <strong>
                                        <a href="#(CPATH)/admin/message/jpress_addon_message/edit/#(entry.id)"> #(entry.id ??) </a>
                                    </strong>
                                    <div class="jp-action-card">
                                        <div class="jp-action-body">
                                            <a href="/admin/message/jpress_addon_message/edit/#(entry.id)">编辑</a> |
                                            <a href="javascript:;" class="red-action"
                                               onclick="doDel('#(entry.id)')">删除</a>
                                        </div>
                                    </div>
                                </td>

	                                <td>#(entry.name ??)</td>
	                                <td>#(entry.phone ??)</td>
	                                <td>#(entry.email ??)</td>
	                                <td>#(entry.title ??)</td>
	                                <td>#(entry.content ??)</td>
	                                <td>#(entry.show ??)</td>
                            </tr>
                            #else
                            <tr class="nodata"><td colspan="999">暂无数据</td> </tr>
                            #end
                            </tbody>
                        </table>
                    </div>
                    <!-- /.card-body -->
                    <div class="card-footer">
                        <div class="row">
                            <div class="col-sm-6">
                                <div class="row">

                                    <div class="form-group">
                                        <div class="form-check">
                                            <input class="form-check-input tableCheckAll" id="checkall" type="checkbox" >
                                            <label class="form-check-label" for="checkall">全选</label>
                                        </div>
                                    </div>
                                    <div class="form-group col-lg-3">
                                        <select class="form-control" name="action">
                                            <option value="">请选择...</option>
                                            <option value="doDelByIds" open-type="del-confirm">
                                                批量删除
                                            </option>
                                        </select>
                                    </div>

                                    <div class="form-group col-lg-3">
                                        <button type="button" class="btn btn-outline-primary batchExec">批量操作</button>
                                    </div>
                                </div>
                            </div>

                            <div class="col-sm-6">
                                #@_paginate()
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /.card -->
            </div>
    </section>
#end
